<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: JL_mooTabs.class.php 1126 2008-06-09 05:45:04Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

// deprecated due to mootools conflict with template. Use JLTabs instead.
class JL_mooTabs{
  
  var $tabcontrol;
  var $tabpanel;
  
  function JL_mooTabs() {
    global $mainframe;
		if (!defined('JL_TABS_INITIATED')) {
		  $mainframe->addCustomHeadTag( '<link rel="stylesheet" href="'.JL_TEMPLATE_FOLDERS_URL.'/css/mootabs1.2.css" type="text/css" media="screen" title="no title" charset="utf-8" />' );
      $mainframe->addCustomHeadTag( '<script src="'.JL_URL_FOLDER.'/js/mootools.v1.1.js" type="text/javascript" charset="utf-8"></script>' );
      $mainframe->addCustomHeadTag( '<script src="'.JL_URL_FOLDER.'/js/mootabs1.2.js" type="text/javascript" charset="utf-8"></script>' );
      define('JL_TABS_INITIATED', TRUE);
	  }
	}
  function startPane ( $container_id , $init=true) {
    global $mainframe;
    $this->container = $container_id;
    $this->init = ($init) ? $init : false;
    if ($this->init) echo '<div id="'.$container_id.'" class="mootabs">';
    $this->tabcontrol .= '<ul class="mootabs_title">';
		$this->tabpanel = '';      
  }
  function makeTab( $tabid, $tablabel, $tabcontent=false ) {
    $this->tabcontrol .= '<li title="'.$tabid.'" class="mootabs_title">'.$tablabel.'</li>';
    if ($tabcontent) $this->tabpanel .= '<div id="'.$tabid.'" class="mootabs_panel">'.$tabcontent.'</div>';
  }
  function renderTab () {
    echo $this->tabcontrol.'</ul>';
    if ($this->tabpanel !='') echo $this->tabpanel;
    $this->tabcontrol ='';
    $this->tabpanel='';
  }
  function endPane() {
    global $mainframe;
    if ($this->init) echo '</div>';
    $mainframe->addCustomHeadTag( "<script type='text/javascript'>

      window.addEvent('domready', jl_init_tabs".$this->container.");
      function jl_init_tabs".$this->container."() {
      JLTabs_".$this->container." = new mootabs('".$this->container."', {height: 'auto', width: '100%', changeTransition: 'none', mouseOverClass: 'over', activateOnLoad:		'first'});
      }

      </script>" );
  }
}

?>
